//
//  CalenderHeaderView.m
//  CalenderDemo
//
//  Created by wr on 2018/7/23.
//  Copyright © 2018年 stzen. All rights reserved.
//

#import "CalenderHeaderView.h"
#import "UIView+Frame.h"

@implementation CalenderHeaderView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubViews];
    }
    return self;
}

- (void)createSubViews {
    UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
    
    self.headerLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, 100, self.height)];
    self.headerLabel.backgroundColor = [UIColor whiteColor];
    self.headerLabel.textColor = [UIColor lightGrayColor];
    self.headerLabel.font = [UIFont systemFontOfSize:15.f];
    self.headerLabel.textAlignment = NSTextAlignmentLeft;
    [headerView addSubview:self.headerLabel];
    
    UIView *line = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.headerLabel.frame), (self.height - 1) * 0.5, self.width - 100 - 20, 1)];
    line.backgroundColor = [UIColor lightGrayColor];
    [headerView addSubview:line];
    
    [self addSubview:headerView];
}


@end
